package com.dyna.controller;

import com.dyna.domain.form.event.LuckyBagEventForm;
import com.dyna.domain.resp.R;
import com.dyna.domain.resp.lucky.LuckyBagResp;
import com.dyna.service.LuckyBagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api("千岛/福袋")
@RestController
@AllArgsConstructor
@RequestMapping(value = "/lucky_bag")
public class LuckyBagController {

    private final LuckyBagService luckyBagService;

    @ApiOperation("福袋列表")
    @RequestMapping("/list")
    public R<List<LuckyBagResp>> list() {
        return null;
    }

    @ApiOperation("发布福袋")
    @RequestMapping("/add")
    public R<Boolean> add(@RequestBody @Validated LuckyBagEventForm form) {
        return R.isSuccess(luckyBagService.add(form));
    }

}
